<?php include "top.php"; ?>
 <?php
		 $nid=make_safe($_GET["nid"]); 
		 $BigClassName=make_safe($_GET["BigClassName"]); 
		 if($nid==""){$nid=1;}
		 
		if($nid==1){$nidname="公司樣本";}
		 if($nid==2){$nidname="禮服";}
		 if($nid==3){$nidname="客戶";}
		 
		 
		?>
      <div id="top-3">
        <div id="m-text-1">
        <table border="0" cellpadding="0" cellspacing="0" class="tab-5">
   <tr>
     <td valign="top"><div class="tab-5-tit">主功能列表</div>
     <div class="m-text-2_btn"><a href="category.php?nid=<?php echo $nid;?>">作品分類管理</a></div>
     <div class="m-text-2_btn"><a href="target.php?nid=<?php echo $nid;?>" >標簽管理</a></div>
      <div class="tab-5-tit">相簿管理</div>
      
	 
	 <?php
  $n=1;

  $sql="select * from product_type_big where nid='$nid' order by orderid  ";			
	$result=mysql_query($sql);
	while ($row=mysql_fetch_object($result)){
	?>
     <div class="m-text-2_btn"><a href="working.php?nid=<?php echo $nid;?>&BigClassName=<?php echo urlencode($row->BigClassName);?>"><?php echo $row->BigClassName;?></a></div>
     <?php }?>
	 
	 
	 
	 
	 
	

       </td>

   </tr>

   </table>

        </div>
	 
	 
	 
	 
	 
        <div id="m-text-2_banner">
          <ul>
           
            <li>/ </li>
            <li><a href="working_add.php?nid=<?php echo $nid;?>&BigClassName=<?php echo urlencode($BigClassName);?>">新增相簿</a></li>
            <li><?php echo $nidname;?>相簿管理</li>
          </ul>
        </div>
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		<div id="m-text-2">






<script language="javascript"> 



function Checker(){ 


  
// document.write(document.form2.id.length)
  
  
  
   //if(document.form2.yaoyun.value==""){document.write("您按了确认！") }
   
   //  document.write("您按了确认！") 

   

document.form2.items.value = "";         //设置隐藏域的值为空
if ( !document.form2.id.length ) {      //只有一个复选框，form2.item.length = undefined



	if ( document.form2.id.checked ){
	document.form2.items.value = document.form2.id.value; 
	
	
	} 
}else { 

	var temp="";
	for ( i = 0 ; i < document.form2.id.length ; i++ ){ 
		if ( document.form2.id[i].checked ){       //复选框中有选中的框 
			temp=temp+document.form2.id[i].value+",";   //将数组中的元素使用","分隔
		}	 

	} 
	temp=temp.substring(0,temp.length-1);     //去除字符串末尾多余的","
	document.form2.items.value = temp;    //将变量赋值给隐藏域
	
//	document.write(document.form2.items.value)
} 
} 
</script>  <script language="javascript">
function CheckAll(elementsA,elementsB)
{
	var len = elementsA;
	if(len.length > 0)
	{
		for(i=0;i<len.length;i++)
		{
			elementsA[i].checked = true;
		}
		if(elementsB.checked ==false)
		{
			for(j=0;j<len.length;j++)
			{
				elementsA[j].checked = false;
			}
		}
	}
	else
	{
		len.checked = true;
		if(elementsB.checked == false)
		{
			len.checked = false;
		}
	}
}
</script>



<SCRIPT language=javascript>

function ConfirmDel()
{
   if(confirm("確定要刪除選擇的訊息嗎？一旦刪除將不能恢複！"))
     return true;
   else
     return false;
	 
}

</SCRIPT>





<form name="form2" method="Post" action="working_del.php?nid=<?php echo $nid;?>&BigClassName=<?php echo urlencode($BigClassName);?>" onSubmit="Checker()">

<?php 
	$webname="product";	
		 $title2=make_safe($_GET["title"]);
   if($page){
    $page_size=10;
	$sql="select count(*) as total from ".$webname." where nid='$nid' ";
	if($BigClassName!=""){$sql=$sql." and BigClassName='$BigClassName'";}
	if($SmallClassName!=""){$sql=$sql." and SmallClassName='$SmallClassName'";}
	if($title2!=""){$sql=$sql." and title like '%".$title2."%'";}
	$result=mysql_query($sql);
    $message_count=mysql_result($result,0,"total");
    $page_count=ceil($message_count/$page_size);	
    $offset=($page-1)*$page_size;	
	$sql="select * from ".$webname." where nid='$nid' ";
	if($BigClassName!=""){ $sql=$sql."and BigClassName='$BigClassName'";}
	if($SmallClassName!=""){$sql=$sql." and SmallClassName='$SmallClassName'";}
	if($title2!=""){$sql=$sql." and title like '%".$title2."%'";}
	$sql=$sql."order by id desc limit $offset, $page_size";
	$result=mysql_query($sql);
	while ($row=mysql_fetch_object($result)){
	
		  $aa=getimagesize("../".$row->images);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高

if($weight>=$height){$weight1=160;$height1=160*$height/$weight;}
if($height>=$weight){$height1=160;$weight1=160*$weight/$height;}
	
	?>

<table border="0" cellpadding="0" cellspacing="0" class="album_photo">
          <tr>
            <td class="photo">
			<?php if($row->images!=""){?>
			<a href="product2.php?nid=<?php echo $row->nid;?>&BigClassName=<?php echo urlencode($row->BigClassName);?>&title=<?php echo urlencode($row->title);?>" title="點擊查看此相簿作品"><img  src="<?php echo "../".$row->images;?>" width="<?php echo $weight1;?>" height="<?php echo $height1;?>" border="0" /></a>
			<?php }else{?>
			<td ><a  href="product2.php?nid=<?php echo $row->nid;?>&BigClassName=<?php echo urlencode($row->BigClassName);?>&title=<?php echo urlencode($row->title);?>" title="點擊查看此相簿作品"><img src="../working/noimages.gif" width="107" height="160" border="0" /></a></td>
			<?php }?>
			</td>
          </tr>
          <tr>
            <td class="photo-txt"><input name="id" type="checkbox" id="id" value="<?php echo $row->id;?>">
              類別：<?php echo $row->BigClassName;?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color:#000000" href="working_xiugai.php?id=<?php echo $row->id;?>&nid=<?php echo $row->nid;?>">修改</a></td>
          </tr>
        </table>

<?php }}?>



<table border="0" cellpadding="0" cellspacing="0" class="m-text-2-con">
          <tr> <input type="hidden" name="items" value="<?php echo $item; ?>">
            <td width="250" height="30"><input name="chk_all" type="checkbox" id="chk_all" value="checkbox" onClick="CheckAll(this.form.id,this.form.chk_all)">
              選擇本頁顯示的所有訊息</td>
            <td><input name="submit" type='submit' value='刪除選擇的訊息' onClick="return ConfirmDel();">
                        </td>
          </tr>
      </table>
</form>












         <table border="0" cellpadding="0" cellspacing="0" id="album_botton">
       <tr>
            <td  colspan="13" bgcolor="#DADDFE" scope="col">
              <div align="center">總共&nbsp;<?php echo $message_count;?> 條記錄&nbsp;&nbsp;頁次：
			  <?php 
			  $BigClassName=make_safe($_GET["BigClassName"]);
			  $BigClassName=urlencode($BigClassName);
			  if($page!=1)
				   {
				     echo  "<a href=?page=1&BigClassName=".$BigClassName.">首頁</a>&nbsp;&nbsp;&nbsp;";
					 echo "<a href=?page=".($page-1)."&BigClassName=".$BigClassName.">上一頁</a>&nbsp;&nbsp;&nbsp;";
				   } echo $page;?> / <?php echo $page_count;?> 頁&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
              <?php
	  		  
				  if($page<$page_count)
				   {
				        echo "<a href=?page=".($page+1)."&BigClassName=".$BigClassName.">下一頁</a>&nbsp;&nbsp;&nbsp;";
				        echo  "<a href=?page=".$page_count."&BigClassName=".$BigClassName.">尾頁</a>&nbsp;&nbsp;&nbsp;&nbsp;";
				   
				   }
				   
				 
				?>
                 &nbsp;&nbsp;&nbsp;跳轉到
                 <script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
                 <select name="jumpMenu" id="jumpMenu" onChange="MM_jumpMenu('self',this,0)">
                 
                 <?php 
				 for($i=1;$i<=$page_count;$i++){
				 ?>
                   <option value="?page=<?php echo $i;?>" <?php if($page==$i){echo "selected";}?>><?php echo $i;?></option>
                   <?php }?>
                </select>頁</div>               
            </span></td>
        </tr>
     </table>

	 
	 
	 </td>
   </tr>
   </table>
        </div>
		
		
		
		
		
		
		
      </div>
	  
	 
	
	  
	  
    </div>
  </div>
</div>
<div id="botton"><div id="copyright"><table border="0" cellpadding="0" cellspacing="0" class="copy">
  <tr>
    <td>© COPYRIGHTS 2010 INC. APARTMENT STUDIO All rights reserved.</td>
  </tr>
</table>
</div></div>
</body>
</html>